<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 冒泡排序（死记硬背）
        var arr=[1,4,3,4]
            var temp;
        for(var i=0;i<arr.length;i++){
            console.log(arr)
            console.log(arr[i])
            for(var j=0;j<arr.length;j++){
                console.log("-------------"+arr)
                console.log(arr[j])
                if(arr[i]>arr[j]){
                    temp=arr[i];
                    arr[i]=arr[j]
                    arr[j]=temp
                }
            }
        }
        

    </script>
</body>
</html>